package com.usdt.system.domain.resp;

import java.util.List;

import org.springframework.util.CollectionUtils;

import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Tag(name = "销售统计VO")
public class SalesCountRespVO {

	private Integer sum;
	
	private List<SalesDataRespVO> salesDataList;

	public Integer getSum() {
		if(!CollectionUtils.isEmpty(salesDataList)) {
			Integer s = 0;
			for (SalesDataRespVO salesDataRespVO : salesDataList) {
				s = s + salesDataRespVO.getCount();
			}
			return s;
		}
		return sum;
	}
}
